
#include "gpio.h"
#include "hc32_common.h"

void gpioShakeConfig(void)
{
    stc_gpio_init_t stcPortInit;
    MEM_ZERO_STRUCT(stcPortInit);
 	stcPortInit.u16PinState = PIN_STAT_RST;//默认电平
    stcPortInit.u16PinDir = PIN_DIR_IN;
    GPIO_Init(SHAKE_PORT, SHAKE_PIN, &stcPortInit); 
}

void gpioLedConfig(void)
{
	stc_gpio_init_t stcGpioInit;

	GPIO_StructInit(&stcGpioInit);
	stcGpioInit.u16PinState = PIN_STAT_RST;
	stcGpioInit.u16PinDir = PIN_DIR_OUT;
	GPIO_Init(LED_PORT, LED_PIN, &stcGpioInit);
}
	

void gpioSpiConfig(void)
{
    stc_gpio_init_t stcPortInit;
    MEM_ZERO_STRUCT(stcPortInit);
//	stcPortInit.u16PinState = PIN_STAT_RST;//默认电平
    stcPortInit.u16PinDir = PIN_DIR_OUT;
    GPIO_Init(CE_PORT, CE_PIN, &stcPortInit);
    GPIO_Init(CSN_PORT, CSN_PIN, &stcPortInit);
    CSN_H;
}


void gpioXn297lIQRConfig(void)
{
    stc_gpio_init_t stcPortInit;
    MEM_ZERO_STRUCT(stcPortInit);
 	stcPortInit.u16PinState = PIN_STAT_RST;//默认电平
    stcPortInit.u16PinDir = PIN_DIR_IN;
    GPIO_Init(IRQ_PORT, IRQ_PIN, &stcPortInit); 
}


